//
// Created by Administrator on 2023/11/23.
//
#include "bits/stdc++.h"

using namespace std;

class Solution {
public:
    int findMissMin(vector<int> &nums) {
        int n = 1e5 + 10;
        bool hash[n];
        memset(hash,0, sizeof hash);
        for (int num: nums) {
            //数组的长度为1e5 最小正整数最多是1e5+1
            if (num > 1e5  + 1||num <= 0)continue;
            hash[num] = true;
        }
        for (int i = 1; i < n; ++i) {
            if (!hash[i])return i;
        }
    }
};

int main() {
    vector<int> a = {-74298347, 35927, 27313, 27928, 108318822, 279930063, 689508564, 18022, -611081886, 4304, -939280693, 72650, 226538462, -647989754, 329495089, 456, -355034644, -366621006, -394716771, 80158, 301862463, 361823046, 70531, -650248802, -568118211, -341215043, 86246, 216782477, 4437, -701649005, 29055, -819182482, 30329, 515985075, 626703416, 63758, 78712, -589088495, 37365, -887399994, 37072, -529653004, 541362533, 784831870, -803240391, 91001, 16150, 789542278, 90277, 653051591, 341213676, 479882678, 34292, 28191, 852877619, 64313, -530230659, 24606, 12119, 403813257, 3247, -762658977, 72974, -387182951, -452857551, 418897537, 55767, 229846307, 19321, 81923, 697296774, 50766, 181089832, 5738, 457198428, 80101, 59424219, 71279, -548968680, 86295, 602688216, 80273, 25495, 82754, -313542289, -272308732, -761475430, -405153466, 53424, 14602, 25096, 801468987, 729782852, 46082, 492878915, 34429, 30607, -770685109, -389769304, 47713865, -373420052, -131020505, -582048929, -169484076, 451307981, -640678838, 825644775, 12006, -32544801, -720889357, 88378, 45547, 71796, 199237665, -535876608, 612592142, 32133, 16935, -233333540, 59685, 96043, 19744, -593081389, 883176784, -578846630, 827426920, 55349, -975194031, 794369256, -279944481, 43627, -329988092, 13078, 860973870, -759010162, 37003, 53539, 76145, -402770988, 56834, 96995, 470243725, -986344899, 49718, 556946922, -342077008, -761673038, -989086781, -422000064 };
    Solution s;
    cout << s.findMissMin(a);
}